<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <title>资金流动类型</title>
    <th:block th:include="~{common/common::commonHead}"/>
</head>
<!-- /Head -->
<!-- Body -->
<body>
<!-- Page Body -->
<div class="page-body">
    <div class="panel panel-primary">
        <div class="panel-heading bg-blue">
            资金流动类型
        </div>
        <div class="widget-body grid-table">
            <div class="toolbar">
                <div class="fl-left">
                    <button data-menu-id="070501" data-click="add('prisoner/flowTypeAdd.html','flowType')"
                            class="btn btn-default shiny">新增资金类型
                    </button>
                </div>
                <div class="toolbar-right">
                    <div class="fl-right">
                        <div class="btn-group" role="group">
                            <button data-click="toggleFilter()" class="btn btn-default text-center">
                                <i class="fa fa-filter fa-fw"></i>
                            </button>
                            <button data-click="refresh('flowType')" class="btn btn-default">
                                <i class="fa fa-refresh fa-fw"></i>
                            </button>
                            <button data-click="download('flowType')" class="btn btn-default">
                                <i class="fa fa-download fa-fw"></i>
                            </button>
                        </div>
                    </div>
                </div>
            </div>
            <div id="flowType"></div>
            <form class="filter search-content form-horizontal" role="form">
                <div class="col-xs-6">
                    <div class="form-group">
                        <label class="col-xs-4 control-label"> 流动类型 </label>
                        <div class="col-xs-8">
                            <select name="type" class="form-control spinner">
                                <option value="-1">全部</option>
                                <option value="1">收入</option>
                                <option value="0">支出</option>
                            </select>
                        </div>
                    </div>
                </div>
  <!--              <div class="col-xs-6">
                    <div class="form-group">
                        <label class="col-xs-4 control-label"> 状态 </label>
                        <div class="col-xs-8">
                            <select name="status" class="form-control spinner">
                                <option value="-1">全部</option>
                                <option value="1">已开户</option>
                                <option value="2">未开户</option>
                            </select>
                        </div>
                    </div>
                </div>-->
                <div class="col-xs-12">
                    <button type="button" data-click="hideFilter()" class="btn btn-default pull-right">取消</button>
                    <button type="button" data-click="submitFilter('flowType')" class="btn btn-blue pull-right">确定
                    </button>
                </div>
            </form>
        </div>
    </div><!-- end of panel -->
    <!-- /Page Container -->
    <!-- Main Container -->

</div>
</body>
<!--  /Body -->
</html>
<script>
    $(function () {
        $("#flowType").gridTable({
            url: "flowType/pageFlowType",
            columns: [
                {title: "流动名称", field: "name"},
                {title: "状态", field: "statusStr"},
                {title: "流动类型", field: "type",format:toType}
            ],
            idField: "id",
            infoUrl: "prisoner/flowTypeInfo.html",
            editUrl: "prisoner/flowTypeEdit.html",
            delUrl: "prisoner/delFlowType"
        });
    });
    //判断状态
    function toType(status){
        switch (status) {
            case '0':
                return "<span class='label label-orange'>支出</span>";
            case '1':
                return "<span class='label label-success'>收入</span>";
            default:
                return status;
        }
    }
</script>